﻿' This software is licensed under Microsoft Public License (Ms-PL), which governs use of the accompanying software. 
' If you use the software, you accept this license. 

' The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, 
' guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot 
' change. To the extent permitted under your local laws, the contributors exclude the implied warranties of 
' merchantability, fitness for a particular purpose and non-infringement.

Imports System.Net
Imports System.Runtime.Serialization

Namespace Rest
    ''' <summary>
    ''' Returns a new instance of the RestFaultException class.
    ''' </summary>
    ''' <remarks></remarks>
    <Serializable()>
    Public Class RestFaultException
        Inherits Web.WebFaultException(Of ErrorDetails)

#Region "Constructor"
        ''' <summary>
        ''' Returns a new instance of the RestFaultException class.
        ''' </summary>
        ''' <param name="details">Detail provided to the exception.</param>
        ''' <remarks></remarks>
        Public Sub New(ByVal details As ErrorDetails)
            MyBase.New(details, HttpStatusCode.BadRequest)
        End Sub

        ''' <summary>
        ''' Returns a new instance of the RestFaultException class, with both detail and statuscode.
        ''' </summary>
        ''' <param name="details">Detail provided to the exception.</param>
        ''' <param name="statusCode">Status code of the exception.</param>
        ''' <remarks></remarks>
        Public Sub New(ByVal details As ErrorDetails, ByVal statusCode As HttpStatusCode)
            MyBase.New(details, statusCode)
        End Sub
#End Region

    End Class
End Namespace
